

<div style="width: 650px; top:500px; clear: both;" class="body " id="main">
	<div id="content">
		<article class="round_edge_10px block" id="main_post_box">
<?

if(isset($this->errorMessage)){

		echo $this->errorMessage;

}?>

	<?php foreach ($this->data as $university){?>
		<a href="/message/getmessages?venue_id=<?=$university->getVenue_id()?>"><span><?=$university->getVenue_name()?></span></a>
                &nbsp;&nbsp;
        <?php }?><br/>
		</article>

	</div>
	<div id="sidebar">
        <aside id="featured1" name="bulletin" class="round_edge_10px block featured">
		<h4>Bulletin</h4>
                <?if (true){
                    echo "This is the day!";
                }?>
  	</aside>
        
	<!--end of featured recommendation-->
	</div>
        </div>
<script>
    var locationtemp;
    var selected;
    $(function(){
      try{
      $('#location_ac').autocomplete({
                    source:"/search/vac",
                    minLength:2,
                    success: function(data){
                        locationtemp=data;
                        alert('Success!');
                    },
                    focus:function(event,ui){
                    },
                    select:function(event,ui){
                        selected=ui.item;
                    }
                });
//                alert('autocomplete finished init!');
		}catch (e){alert(e);}
		// end of the init for autocomplete
		// start of the init for jquery loading search result
		}
		);
                function main_post_submit(){
                    alert("mp submit start.");
                    var content=$("#publish_editor").val();
                    if (!content){
                        alert("Please enter key in something before you post!");
                        return false;
                    }
                    //var uid= //$("#id_field").
                    if (!selected){
                        alert("Please enter/choose your location!");
                        return false;
                    }

                    $.post("/message/postmessage",
                    {'message_content':content,'venue_name':selected['_venue_name'],'venue_id':selected['_venue_id'],'message_id':'0'},
                        function(json_data){
                            alert(json_data.toString());
                            },
                        'json');
//                    alert('mp submit ends.');
                }

</script>
